package com.jugheadzhou.gateway.configure;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author jugheadzhou
 * @date 2021-09-28
 */
@Configuration
public class RouteConfigure {

    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
        return builder.routes()
                .route("path_route", r -> r.path("/go").uri("https://studygolang.com/"))
                .build();
    }

}
